package com.wxh.boot.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 系统配置，加载application的配置
 *
 * @author wxh
 */
@Component
@ConfigurationProperties(prefix = "system")
public class SystemProperties {
    private long systemId;
    private String systemName;
    private boolean dev;

    public long getSystemId() {
        return systemId;
    }

    public void setSystemId(long systemId) {
        this.systemId = systemId;
    }

    public String getSystemName() {
        return systemName;
    }

    public void setSystemName(String systemName) {
        this.systemName = systemName;
    }

    public boolean isDev() {
        return dev;
    }

    public void setDev(boolean dev) {
        this.dev = dev;
    }

    @Override
    public String toString() {
        return new StringBuilder()
                .append("系统标识：").append(systemId)
                .append("，系统名称：").append(systemName)
                .append("，系统环境：")
                .append(dev ? "开发环境" : "生产环境").toString();
    }
}
